#!/usr/bin/env python
from Sms import *

class DTOSurvey:
    def __init__(self, surveyId, text):
	self._phoneList = []
	self._text = "Q%d:\n%s" %(surveyId, text)
    def addPhoneNumber(self, phoneNumber):
	self._phoneList.append(phoneNumber)
    def getSms(self):
	pn = self._phoneList.pop()
	sms = Sms(pn, self._text)
	#print "\t>> DTOSurvey.getSms(): [[%s]]" %sms
	return sms #Sms(pn, self._text)
    def hasNext(self):
	return ( len(self._phoneList)>0 )
    def __str__(self):
	s = "DTOSurvey\n"
	s += "text: [\n%s\n]\n" %self._text
	s += "participants: "+str(self._phoneList)
	return s
